<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0">
		<title>mobile</title>
		<script>
			let c=()=>{
				let w=document.documentElement.clientWidth;
				let n=Math.min(20*(w/320),40)+'px';
				document.documentElement.style.fontSize=n;
			}
			window.addEventListener('load',c);
			window.addEventListener('resize',c);
		</script>
		<style>
			div{
				font-size: 3rem;
			}
		</style>
	</head>
	<body>
		<div>hello</div>
	</body>
</html>